#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2019/3/11 5:46 PM
# @Author  : Hardy
# @File    : t1.py

# TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
import pandas as pd


# Helper libraries
import numpy as np
import matplotlib.pyplot as plt

print(tf.__version__)

fashion_mnist = keras.datasets.fashion_mnist

(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
model = keras.Sequential([
    keras.layers.Flatten(input_shape=(28, 28)),
    keras.layers.Dense(128, activation=tf.nn.relu),
    # keras.layers.Dense(128, activation=tf.nn.relu),
    keras.layers.Dense(10, activation=tf.nn.softmax)
])

model.compile(optimizer=tf.train.AdamOptimizer(),
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

train_images = train_images / 255.0

test_images = test_images / 255.0


print(train_images.shape)

model.fit(train_images, train_labels, epochs=5)


class MT(keras.Model):
    def __init__(self):
        pass

    def forward(self):
        pass